#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: fdm=marker fmr={{{,}}} cms=#%s

import os
import sys

SOAR=os.environ.get('SOAR')
if not SOAR:
#SOAR='/opt/soar'
    SOAR='../../..'
sys.path.append(SOAR+'/common/python')
try:
    from soar import *
except ImportError:
    print >>sys.stderr, '''\
Import soar fail 
%s
%s
''' % (sys.exc_value, sys.version)
    sys.exit(1)

def main(argc, argv):
#{{{
    line=1

    try:
        log=errlog.errlog(argv[0], '_log')
    except errlog.error, e:
        print >>sys.stderr, 'init errlog fail, %s' % e
        return 1
    log.write('file no.%d line' % line)
    line+=1

    try:
        log=errlog.errlog(argv[0], '//localhost:10000')
    except errlog.error, e:
        print >>sys.stderr, 'init errlog fail, %s' % e
        return 1
    log.write('sn_log no.%d line' % line)
    line+=1
#}}}

if __name__ == '__main__':
    main(len(sys.argv), sys.argv)
